# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=low-memory-monitor
pkgver=2.1
pkgrel=1
pkgdesc="Daemon to monitor memory usage and signal processes and the kernel"
options="!check" # No testsuite
url="https://gitlab.freedesktop.org/hadess/low-memory-monitor"
arch="all"
license="GPL-3.0-or-later"
makedepends="meson glib-dev"
subpackages="$pkgname-openrc"
source="https://gitlab.freedesktop.org/hadess/low-memory-monitor/-/archive/$pkgver/low-memory-monitor-$pkgver.tar.gz
	low-memory-monitor.initd
	musl.patch
	"

build() {
	abuild-meson \
		-Dgtk_doc=false \
		-Dsystemdsystemunitdir=/DELETEME \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output

	# Remove systemd service
	rm -rf "$pkgdir"/DELETEME

	install -Dm0755 "$srcdir"/low-memory-monitor.initd "$pkgdir"/etc/init.d/low-memory-monitor
}
sha512sums="5357f31280ff2cbf649aec75d72f74ab1530fdfc3ab1aef1141fd3cf8b4f752daa992e347c588f07bdd6d91a8efeca6bfe65098ad7cd28b1e167c0e636f2cda5  low-memory-monitor-2.1.tar.gz
ca605e75884c1dc1cfbc9efcd825c58fe3e0b950b1d6ad3941b06d56621b90c495964f7c4654535cdb254ebaa23acfdfef8f3b8b904d5e0eda42160db3197627  low-memory-monitor.initd
7cd0bfa4e2b374a3b7d252a18fc83ff4ecbd52d22c40e406e10ba776daad80e7dc3d3c339b556a89a97786fe541e2aff7f32097aed5473a069612344d981ab23  musl.patch"
